//
// Created by HP on 2025/11/26.
//

#ifndef FLIGHTSERVER_TRAIN_H
#define FLIGHTSERVER_TRAIN_H
#include "Model.h"
#include <string>

// 火车类型常量定义
class TrainType {
public:
    static const std::string HighSpeed;    // 高铁
    static const std::string BulletTrain;  // 动车
    static const std::string OrdinaryTrain; // 普通火车
};

// 火车或高铁或动车模型
class Train : public Model {
public:
    std::string id;
    std::string name;         // 车次号
    std::string type;         // 火车类型
    std::string company;      // 运营公司
    std::string createdAt;

    Train();

    void bind(const std::string& key, const std::string& value);

    bool save();

    static int getIdFromKey(const std::string& key, const std::string& value);
    
    // Getter methods
    std::string getId() const { return id; }
    std::string getName() const { return name; }
    std::string getType() const { return type; }
    std::string getCompany() const { return company; }
    std::string getCreatedAt() const { return createdAt; }
    
    // Setter methods
    void setId(const std::string& newId) { id = newId; }
    void setName(const std::string& newName) { name = newName; }
    void setType(const std::string& newType) { type = newType; }
    void setCompany(const std::string& newCompany) { company = newCompany; }
};


#endif //FLIGHTSERVER_TRAIN_H
